class ControlPanel:
    def __init__(self):
        self.password = "1234"  # 预设密码
        self.input_buffer = ""  # 输入缓冲
        self.failed_attempts = 0  # 输入密码失败次数
        self.locked = False  # 控制面板锁定状态
        self.locked_time = 0  # 锁定开始时间
        self.locked_duration = 120  # 锁定时长（秒）

    def enter_character(self, char):
        if self.locked:
            current_time = 0  # 获取当前时间，这里用0代替
            if current_time - self.locked_time >= self.locked_duration:
                self.locked = False
                self.failed_attempts = 0

        if not self.locked:
            self.input_buffer += char
            if len(self.input_buffer) == len(self.password):
                if self.input_buffer == self.password:
                    print("密码正确！进入系统功能选择状态。")
                    self.input_buffer = ""
                    # 进入系统功能选择状态
                else:
                    self.failed_attempts += 1
                    self.input_buffer = ""
                    if self.failed_attempts >= 3:
                        self.locked = True
                        self.locked_time = current_time
                        print("密码错误3次，控制面板已锁定。")
                        return

    def get_status(self):
        if self.locked:
            return "控制面板已锁定"
        elif self.input_buffer:
            return f"读取键入字符：{self.input_buffer}"
        else:
            return "控制面板空闲"

# 示例使用：
panel = ControlPanel()
print(panel.get_status())
panel.enter_character("1")
print(panel.get_status())
panel.enter_character("2")
print(panel.get_status())
panel.enter_character("3")
print(panel.get_status())
panel.enter_character("4")
print(panel.get_status())
panel.enter_character("5")
print(panel.get_status())
